﻿<%@ Page Title="Contacts" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Contacts.aspx.cs" Inherits="MyNet.WebUI.Contacts" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <style>
        .column {
            float: left;
            width: 45%;
        }
    </style>


    <div class="column">
        <h2>List of Contacts</h2> 
        <asp:UpdatePanel runat="server">
            <ContentTemplate>
                <asp:GridView ID="ContactsGridView" runat="server" 
                    DataSourceID="MyNetDbServiceClient"
                    AutoGenerateColumns="False" >
                    <Columns>
                        <asp:BoundField DataField="Id" HeaderText="Id" />
                        <asp:BoundField DataField="Firstname" HeaderText="Firstname" />
                        <asp:BoundField DataField="Lastname" HeaderText="Lastname" />
                    </Columns>
                </asp:GridView> 

                <asp:ObjectDataSource ID="MyNetDbServiceClient" runat="server"
                    TypeName="MyNet.WebUI.MyNetDbService.MyNetDbServiceClient"
                    SelectMethod="getContacts" >
                </asp:ObjectDataSource>
            </ContentTemplate>
        </asp:UpdatePanel>



    </div>


    <div class="column">
        <!--
        <h2>Operations</h2>
        -->
        <h3>Import Contacts</h3>
        <asp:UpdatePanel ID="UpdatePanel" runat="server">
            <ContentTemplate>
                <asp:Button ID="ImportFacebookContactsButton" runat="server" 
                    Text="Facebook Import" 
                    OnClick="ImportFacebookContactsButton_Click" 
                />
                
                <asp:UpdateProgress ID="ImportProgress" runat="server" AssociatedUpdatePanelID="UpdatePanel">
                    <ProgressTemplate>
                        Importing...
                        <img alt="progress" src="../Images/ajax-loader.gif" />
                    </ProgressTemplate>
                </asp:UpdateProgress>
                <br />

            </ContentTemplate>
        </asp:UpdatePanel>
        <!--
        <h3>Add Contact</h3>

        Firstname <asp:TextBox ID="FirstnameTextBox" runat="server"/> <br />
        Lastname <asp:TextBox ID="LastnameTextBox" runat="server"/> <br />
        <asp:Button ID="AddContactButton" runat="server" Text="Add" OnClick="AddContactButton_Click" />

        <h3>Remove Contacts</h3>
        <asp:Button ID="RemoveContactsButton" runat="server" Text="Remove All" OnClick="RemoveContactsButton_Click" />
        <br />
        -->
    </div>


    
    


    



   





</asp:Content>